package net.oschina.git.hikoyan.helloapi.controller;

import com.wordnik.swagger.annotations.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by yan on 16/11/16.
 */
@RestController
@Api(value = "user-api", description = "有关于用户的CURD操作")
@RequestMapping("/user")
public class UserController {


    @RequestMapping(value = "/create", method = RequestMethod.POST)
    @ApiOperation(value = "create用户", httpMethod = "POST", notes = "create用户")
    @ApiResponses(value = {@ApiResponse(code = 405, message = "invalid input")})
    public void create(@ApiParam(required = true, name = "username", value = "用户名") @RequestParam(value = "username") String username,
                         @ApiParam(required = true, name = "password", value = "密码") @RequestParam(value = "password") String password) {

    }

    @RequestMapping(value = "/update", method = RequestMethod.POST)
    @ApiOperation(value = "update用户", httpMethod = "POST", notes = "update用户")
    public String update() {

        return "update";
    }

    @RequestMapping(value = "/find", method = RequestMethod.POST)
    @ApiOperation(value = "find用户", httpMethod = "POST", notes = "find用户")
    public String find() {

        return "find";
    }

    @RequestMapping(value = "/delete", method = RequestMethod.POST)
    @ApiOperation(value = "delete用户", httpMethod = "POST", notes = "delete用户")
    public String delete() {

        return "delete";
    }
}
